Link two different modules using an unique attribute

Hi,

I have two formal modules A and B. In both the modules, there is one particular attribute called "Unique" which has the same values. Using this "unique" attribute i want to create link between Module A and Module B for all the Object heading in Module A.
SO the result will be like, all the object heading in Module A will have an outgoing link which goes to Module B.

Is there any simple method in DOORS to do this. Or any DXL script already available in any thread in this forum.

Could anyone suggest me an option.

Thanks.
AshokNandha - Thu Jun 07 08:38:42 EDT 2012

Re: Link two different modules using an unique attribute
llandale - Thu Jun 07 11:53:35 EDT 2012

So link oA to oB when they share the same attribute value. here's a possible outline.

// create skip list lookup of B objects with UniqueValue
Skip skpObjectsB = createString()
for oB in mB do
{  Value = oB."UniqueAttribute"
   put(skpObjectsB, Value, oB)  // optionally check for duplicates
}
for oA in mA do
{  Value = oA."UniqueAttribute"
   lnkActual = find existing link to oB, if any
   oBActual = oB this oA is linked to, if any
   if (find (skpObjectsB, Value, oBDesired))
   {   // we want a link from this oA
      if (oBActual == oBDesired) then link already exists, nothing to do
      else
      {     // need a link
         if (!null oBActual) then delete Link lnkActual since its the wrong link
         link oA to oBDesired
      }
   }
   else
   {   // we do not want a link from this oA
      if (!null oBActual) then delete Link lnkActual since its the wrong link
   }
}
delete(skpObjectsB)


-Louie

Re: Link two different modules using an unique attribute
SystemAdmin - Thu Jun 07 12:46:16 EDT 2012

Look for a script in DXL Library (module menus Tools / DXL Library), select "Some example programs.." and then use the script "Example to link objects using a foreign key".
  • Pekka Mäkinen - http://www.softqa.eu/

Re: Link two different modules using an unique attribute
AshokNandha - Fri Jun 08 07:30:36 EDT 2012

HI,

Thanks so much.

I was able to do this with the script and its done.

BR,
Ashok